const mongoose=require('mongoose');

//数据开启连接的方法
function dbConnect() {
    mongoose.connect('mongodb://localhost/shoponline');
    mongoose.connection.once('open',function (err) {
        if (err){
            console.log('MongoDb is not opening!');
        }else {
            console.log('MongDb is opening!');
        }
    })
}

exports.dbConnect=dbConnect;